package com.hbnu.service.impl;

import com.hbnu.dao.OrdersDao;
import com.hbnu.pojo.Order;
import com.hbnu.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Resource
    private OrdersDao ordersDao;
    @Override
    public List<Order> getOrders() {
        return ordersDao.getOrders();
    }

    @Override
    public Order getOrderById(int id) {
        return ordersDao.getOrderById(id);
    }

    @Override
    public int deleteOrderById(int id) {
        return ordersDao.deleteOrderById(id);
    }

    @Override
    public int addOrder(Order order) {
        return ordersDao.addOrder(order);
    }

    @Override
    public int updateOrder(Order order) {
        return ordersDao.updateOrder(order);
    }
}
